package gui.newgui.playerassignmentpanel;

import gui.newgui.IArCompGuiComponent;
import gui.newgui.IController;
import gui.newgui.assignedplayerspanel.AssignedPlayersPanel;
import gui.newgui.unassignedplayerspanel.UnassignedPlayersPanel;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JSplitPane;
import javax.swing.WindowConstants;

public class PlayerAssignmentPanel extends javax.swing.JPanel implements IArCompGuiComponent {
	private IController controller;
	private JSplitPane assignPlayersSplitPane;
	private IArCompGuiComponent unassignedPlayersPanel;
	private IArCompGuiComponent assignedPlayersPanel;

	/**
	 * Auto-generated main method to display this JPanel inside a new JFrame.
	 */
	public static void main(String [] args) {
		JFrame frame = new JFrame();
		frame.getContentPane().add(new PlayerAssignmentPanel());
		frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		frame.pack();
		frame.setVisible(true);
	}

	public PlayerAssignmentPanel() {
		super();
		this.initGUI();
	}

	private void initGUI() {
		try {
			BorderLayout thisLayout = new BorderLayout();
			this.setLayout(thisLayout);
			this.setPreferredSize(new Dimension(400, 300));
			{
				this.unassignedPlayersPanel = new UnassignedPlayersPanel();
				this.assignedPlayersPanel = new AssignedPlayersPanel();
				this.assignPlayersSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, (Component) this.unassignedPlayersPanel, (Component) this.assignedPlayersPanel);
				this.assignPlayersSplitPane.setDividerLocation(this.assignPlayersSplitPane.getHeight());
				this.add(this.assignPlayersSplitPane, BorderLayout.CENTER);
				this.assignPlayersSplitPane.setPreferredSize(new java.awt.Dimension(193, 53));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Override
	public IController getController() {
		return this.controller;
	}
}
